package com.glela.task;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.glela.goods.service.GoodsService;

/**
 * 自动同步商品和品牌信息到ES服务器的定时任务
 * 
 * @author 卫耀华
 * @date 2016-11-15
 *
 */
public class ElasticsearchTask {

	private static final Logger logger = LoggerFactory.getLogger(ElasticsearchTask.class);

	@Autowired
	private GoodsService goodsService;

	public void autoSyncGoodsCToES() {
		logger.info("开始同步C区商品到ES");
		goodsService.syncGoodsCToES();
	}

	public void autoSyncGoodsBToES() {
		logger.info("开始同步B区商品到ES");
		goodsService.syncGoodsBToES();
	}

	public void autoSyncBrandToES() {
		logger.info("开始同步品牌到ES");
		goodsService.syncBrandToES();
	}
}
